<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.w3.org/1999/xhtml">

<head th:replace="_fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
    <link rel="stylesheet" href="../static/css/my.css">
    <!--动画效果-->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" />
    <title>博客首页</title>
</head>

<body class="m-bodyblog">
    <!--导航-->
    <nav th:replace="_fragments :: menu(1)" id="nav" class="ui inverted attached segment m-padded-tb-mini" style="border: none;">
        <div class="ui container">
            <div class="ui inverted secondary stackable menu">
                <h2 class="ui teal header item">DyBlog</h2>
                <a href="#" class="m-item item m-mobile-hide m-text-mini"><i class="home icon"></i>首页</a>
                <a href="#" class="m-item item m-mobile-hide m-text-mini"><i class="idea icon"></i>分类</a>
                <a href="#" class="m-item item m-mobile-hide m-text-mini"><i class="tags icon"></i>标签</a>
                <a href="#" class="m-item item m-mobile-hide m-text-mini"><i class="tags icon"></i>归档</a>
                <a href="#" class="m-item item m-mobile-hide m-text-mini"><i
                        class="calendar check outline icon"></i>时间轴</a>
                <a href="#" class="m-item item m-mobile-hide m-text-mini"><i class="edit outline icon"></i>留言</a>
                <a href="#" class="m-item item m-mobile-hide m-text-mini"><i class="info icon"></i>关于我</a>
                <div class="right item m-mobile-hide">
                    <div class="ui icon  transparent input">
                        <input type="text" placeholder="Search...."></input>
                        <i class="search link icon"></i>
                    </div>
                </div>
            </div>
        </div>
        <!--目录图标-->
        <!--menu_toggle按钮事件，让导航在手机端可以点击展开-->
        <a href="#" class="ui menu_toggle black icon button m-top-right m-mobile-show">
            <i class="sidebar icon"></i>
        </a>
    </nav>
    <br>
    <br>
    <!--中间内容-->
    <div id="waypoint" class="m-container">
        <!--container自适应-->
        <div class="ui stackable container">
            <!--grid分16份-->
            <div class="ui stackable grid">
                <!--前11份左边博客列表-->
                <div class="eleven wide column animate__animated animate__fadeIn">
                    <!--header头部-->
                    <!--attached上下连在一起-->
                    <div class="ui top attached segment">
                        <div class="ui middle aligned two column grid">
                            <div class="column">
                                <div class="ui teal header">博客</div>
                            </div>
                            <div class="right aligned column">
                                共<h3 class="ui orange header m-inline-block m-text-thin" th:text="${page.total}">14</h3>篇博客
                            </div>
                        </div>
                    </div>
                    <!--content博客内容-->
                    <div class="ui attached segment">
                        <!--vertical消除上下两个div的横线-->
                        <div class="ui padded vertical segment m-padded-tb-big" th:each="blog : ${page.records}">
                            <!--16份-->
                            <div class="ui middle aligned mobile reversed stackable grid">
                                <!--11份-->
                                <div class="eleven wide column">
                                    <h3 class="ui header"><a href="#" th:href="@{/blog/{id}(id=${blog.id})}" target="_blank" class="m-black" th:text="${blog.title}">怎么成为世界首富</a></h3>
                                    <p class="m-text" th:text="|${blog.description}.......|">
                                        成为世界首富这也太难了吧，首先您要有一大批继承财产，您要有资深学历，要爱岗、敬业，您还要有多项高薪水的大职业，最好是大老板，少休息、多加班、少花钱</p>
                                    <div class="ui grid">
                                        <div class="eleven wide column">
                                            <div class="ui mini horizontal link list">
                                                <div class="item">
                                                    <img src="../static/images/dy.jpg" th:src="@{/images/dy.jpg}" alt="" class="ui avatar image">
                                                    <div class="content">
                                                        <a href="#" class="header">丁宇</a>
                                                    </div>
                                                </div>
                                                <div class="item">
                                                    <i class="calendar icon"></i> <span th:text="${#dates.format(blog.updateTime,'yyyy-MM-dd')}">2021.4.21</span>
                                                </div>
                                                <div class="item">
                                                    <i class="eye icon"></i> <span th:text="${blog.views}">2345</span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="right aligned five wide column" style="text-align: center;">
                                            <a href="#" class="ui teal basic label m-text-mini m-text-thin">认知升级</a>
                                        </div>
                                    </div>
                                </div>
                                <!--5份-->
                                <div class="five wide column">
                                    <a href="#" th:href="@{/blog/{id}(id=${blog.id})}" target="_blank">
                                        <img src="https://picsum.photos/800/450" th:src="@{${blog.firstPicture}}" alt="" class="ui rounded image">
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--footer底部-->
                    <!--两个按钮-->
                    <div class="ui bottom attached segment" th:if="${page.pages}>1">
                        <div class="ui middle aligned two column grid">
                            <div class="column">
                                <a href="#" th:href="@{/(page=${page.current}-1)}" class="ui teal mini basic button">上一页</a>
                            </div>
                            <div class="right aligned column">
                                <a href="#" th:href="@{/(page=${page.current}+1)}" class="ui teal mini basic button">下一页</a>
                            </div>
                        </div>
                    </div>
                </div>
                <!--后五分右边标签卡片-->
                <div class="five wide column">
                    <!--分类-->
                    <div class="ui segments animate__animated animate__lightSpeedInRight">
                        <div class="ui secondary segment">
                            <div class="ui two column grid">
                                <div class="column">
                                    <i class="idea icon"></i>分类
                                </div>
                                <div class="right aligned column">
                                    <a href="#" target="_blank">more <i class="angle double right icon"></i></a>
                                </div>
                            </div>
                        </div>
                        <div class="ui teal segment">
                            <!--fluid填充-->
                            <div class="ui fluid vertical menu">
                                <a href="#" class="item" th:each="type : ${types}">
                                    <span th:text="${type.name}">学习日志</span>
                                    <div class="ui orange left pointing label" th:text="${#arrays.length(type.dyblogs)}">13</div>
                                </a>
                            </div>
                        </div>
                    </div>
                    <!--标签-->
                    <div class="ui segments m-margin-top-large animate__animated animate__zoomInRight">
                        <div class="ui secondary segment">
                            <div class="ui two column grid">
                                <div class="column">
                                    <i class="tags icon"></i>标签
                                </div>
                                <div class="right aligned column">
                                    <a href="#" target="_blank">more <i class="angle double right icon"></i></a>
                                </div>
                            </div>
                        </div>
                        <div class="ui teal segment">
                            <a href="#" target="_blank" class="ui teal basic left pointing label m-margin-tb-tiny" th:each="tag : ${tags}">
                                <span th:text="${tag.name}">java</span> <div class="detail" th:text="${#arrays.length(tag.dyblogs)}">15</div>
                            </a>
                        </div>
                    </div>
                    <!--最新推荐-->
                    <div class="ui segments m-margin-top-large animate__animated animate__fadeInRight">
                        <div class="ui secondary segment">
                            <i class="bookmark icon"></i>最新推荐
                        </div>
                        <div class="ui segment" th:each="newstblog : ${newstblog}">
                            <a href="#" th:href="@{/blog/{id}(id=${newstblog.id})}" target="_blank" class="m-black m-text-thin" th:text="${newstblog.title}">我的故事</a>
                        </div>
                    </div>
                    <!--二维码-->
                    <h4 class="ui horizontal divider orange header m-margin-top-large">扫码关注我</h4>
                    <div class="ui centered card" style="width: 11em;">
                        <img src="../static/images/dymp1.jpg" th:src="@{/images/dymp1.jpg}" alt="" class="ui rounded image">
                    </div>
                </div>
            </div>
        </div>
    </div>
    <br>
    <br>
    <br>
    <!--目录小导航-->
    <div id="toolbar" class="m-padded m-fixed m-right-bottom" style="display: none !important;">
        <div class="ui vertical icon buttons">
            <div id="toTop-button" class="ui teal button"><i class="chevron up icon"></i></div>
            <div id="toDown-button" class="ui teal button"><i class="chevron down icon"></i></div>
        </div>
    </div>
    <!--底部footer-->
    <footer th:replace="_fragments :: footer" id="db" class="ui inverted vertical segment m-padded-tb-massive">
        <div class="ui center aligned container">
            <!--布局16份,3337-->
            <div class="ui inverted divided stackable grid">
                <div class="three wide column">
                    <div class="ui inverted link list">
                        <div class="item">
                            <img src="../static/images/dymp.jpg" class="ui rounded image" alt="" style="width: 100px;">
                        </div>
                    </div>
                </div>
                <div class="three wide column">
                    <h4 class="ui inverted header m-text-thin m-text-spaced">最新博客</h4>
                    <!--竖着的列表-->
                    <div class="ui inverted link list">
                        <a href="#" class="item">用户故事</a>
                        <a href="#" class="item">用户故事</a>
                        <a href="#" class="item">用户故事</a>
                    </div>
                </div>
                <div class="three wide column">
                    <h4 class="ui inverted header m-text-thin m-text-spaced">联系我</h4>
                    <!--竖着的列表-->
                    <div class="ui inverted link list">
                        <a href="#" class="item">Email：dyinin@qq.com</a>
                        <a href="#" class="item">QQ:2985922950</a>
                    </div>
                </div>
                <div class="seven wide column">
                    <h4 class="ui inverted header m-text-thin m-text-spaced">dingyu</h4>
                    <!--竖着的列表-->
                    <div class="ui inverted link list m-text-thin m-text-spaced m-opacity-mini">
                        <p>这是我的个人博客</p>
                    </div>
                </div>
            </div>
            <div class="ui inverted section divider"></div>
            <p class="m-text-thin m-text-spaced m-opacity-mini">Copyright © 2020-2021 DingYu Designed by DingYu</p>
        </div>
    </footer>
    <!--/*/<th:block th:replace="_fragments :: script">/*/-->
    <script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
    <!--平滑滚动-->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-scrollTo/2.1.3/jquery.scrollTo.min.js"></script>
    <!--滚动检测-->
    <script src="../static/lib/waypoints/jquery.waypoints.js"></script>
    <!--/*/</th:block>/*/-->
    <script>
        $(".menu_toggle").click(function () {
            $(".m-item").toggleClass("m-mobile-hide");
        })
        /**平滑滚动**/
        $("#toTop-button").click(function () {
            $(window).scrollTo(0, 500);
        });
        $("#toDown-button").click(function () {
            $(window).scrollTo('#db', 500);
        });
        /**滚动检测**/
        var waypoint = new Waypoint({
            element: document.getElementById('waypoint'),
            handler: function (direction) {
                if (direction == 'down') {
                    $('#toolbar').show(500);
                } else {
                    $('#toolbar').hide(500);
                }
                console.log('Scrolled to waypoint!')
            }
        })

    </script>
</body>

</html>